package com.wicket.okrapp.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.wicket.okrapp.base.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import com.wicket.okrapp.common.util.RedisUtil;
import com.wicket.okrapp.common.exception.BizException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

import java.util.List;
import java.util.stream.Collectors;
import com.wicket.okrapp.base.service.MOmsTargetTemplateService;
import com.wicket.okrapp.dal.po.mbg.OmsTargetTemplate;

import java.util.ArrayList;
import com.wicket.okrapp.common.exception.Assert;
import com.wicket.okrapp.base.service.MOmsVirtualOrgMemberDeptService;
import com.wicket.okrapp.base.service.MOmsTargetObjectiveService;
import com.wicket.okrapp.dal.po.mbg.OmsTargetObjective;
import com.wicket.okrapp.biz.service.dto.common.TargetTempDto;
import com.wicket.okrapp.biz.service.nb.NbTargetTemp;
import com.wicket.okrapp.base.service.MOmsBasicContentTagRecordService;
import com.wicket.okrapp.dal.po.mbg.OmsBasicContentTagRecord;
import com.wicket.okrapp.biz.service.dto.common.ContTagRcordDto;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComReqDto;
import com.wicket.okrframework.integration.FwBaseBaseClient;
import com.wicket.okrframework.integration.FwBaseTagClient;
import com.wicket.okrframework.integration.dto.AddObjectTagComRespDto;
import com.wicket.okrframework.integration.dto.AddObjectTagComReqDto;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrcomponent.integration.FwCompInterfaceModeClient;
import com.wicket.okrcomponent.integration.dto.ImplementCollectionRemoveExistingDataComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementCollectionRemoveExistingDataComReqDto;
import com.wicket.okrframework.integration.dto.QuerySpaceInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceInfoDetailComReqDto;
import com.wicket.okrapp.base.service.MOmsEvaBatchRelatedSetService;

import java.util.concurrent.Callable;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class TargetTempServiceImpl implements com.wicket.okrapp.biz.service.TargetTempService {
    @Resource
    private RedisUtil redisUtil;
@Resource
  private MOmsTargetTemplateService mOmsTargetTemplateService;
@Resource
  private MOmsVirtualOrgMemberDeptService mOmsVirtualOrgMemberDeptService;
@Resource
  private MOmsTargetObjectiveService mOmsTargetObjectiveService;
@Resource
  private NbTargetTemp nbTargetTemp;
/**
   * D3-1查指标模板详情(公共)[2713]
   * gen by moon at 12/15/2022, 9:21:31 PM
   */
  @Trace(operationName = "D3-1查指标模板详情(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QueryTargetTempDetailComRespDto queryTargetTempDetailCom(QueryTargetTempDetailComReqDto reqDto){
    
      
      OmsTargetTemplate omsTargetTemplate_1 =null;
List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord_1 =new ArrayList<>();
//步骤0: 3-1-01查指标模板详情 - queryTargetTempDetail
     OmsTargetTemplate omsTargetTemplate = null;
    QueryTargetTempDetailReq queryTargetTempDetailReq=new QueryTargetTempDetailReq();
  if(reqDto!=null){
      queryTargetTempDetailReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:84636_1
    }
  
    /*3-1-01查指标模板详情[2213]   */
    Assert.isNull(queryTargetTempDetailReq.getObjectiveTemplateId(),"D3-1查指标模板详情(公共)-3-1-01查指标模板详情-指标模板ID不能为空",false);
      omsTargetTemplate = mOmsTargetTemplateService.queryTargetTempDetail(queryTargetTempDetailReq);
      
      
      omsTargetTemplate_1 = omsTargetTemplate;
    
//步骤1: 3-13-04查业务应用内容标签记录列表 - queryContTagRcordList
     List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord =new ArrayList<>();
    if(omsTargetTemplate !=null){
          QueryContTagRcordListReq queryContTagRcordListReq=new QueryContTagRcordListReq();
  queryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:84664_1
queryContTagRcordListReq.setIsArchive("FALSE");//sourceId:84660_1
queryContTagRcordListReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:84662_1
if(omsTargetTemplate!=null){
      queryContTagRcordListReq.setObjectContentId(omsTargetTemplate.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:84658_1
    }
  
    /*3-13-04查业务应用内容标签记录列表[2243]   */
    Assert.isNull(queryContTagRcordListReq.getObjectContentId(),"D3-1查指标模板详情(公共)-3-13-04查业务应用内容标签记录列表-标签内容ID不能为空",false);
Assert.isNull(queryContTagRcordListReq.getBizAppContentCode(),"D3-1查指标模板详情(公共)-3-13-04查业务应用内容标签记录列表-业务应用内容类型编码不能为空",false);
Assert.isNull(queryContTagRcordListReq.getIsArchive(),"D3-1查指标模板详情(公共)-3-13-04查业务应用内容标签记录列表-是否存档不能为空",false);
Assert.isNull(queryContTagRcordListReq.getSpaceId(),"D3-1查指标模板详情(公共)-3-13-04查业务应用内容标签记录列表-创建于空间ID不能为空",false);
      listOmsBasicContentTagRecord = mOmsBasicContentTagRecordService.queryContTagRcordList(queryContTagRcordListReq);
      
      
      listOmsBasicContentTagRecord_1 = listOmsBasicContentTagRecord;
           }
    
QueryTargetTempDetailComRespDto retData = new QueryTargetTempDetailComRespDto();
  retData.setContTagRcordList(listOmsBasicContentTagRecord_1.stream().map(item -> BeanUtil.toBean(item, ContTagRcordDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:84673_1
if(omsTargetTemplate_1!=null){
      retData.setObjectiveTemplateId(omsTargetTemplate_1.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:84670_1
retData.setObjectiveTemplateNumber(omsTargetTemplate_1.getObjectiveTemplateNumber());//SimpleFieldAssign//sourceId:499249_1
retData.setObjectiveTemplateName(omsTargetTemplate_1.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:499250_1
retData.setObjectiveTemplateDesc(omsTargetTemplate_1.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:499251_1
retData.setObjectiveTemplate(omsTargetTemplate_1.getObjectiveTemplate());//SimpleFieldAssign//sourceId:84672_1
retData.setObjectiveValueType(omsTargetTemplate_1.getObjectiveValueType());//SimpleFieldAssign//sourceId:90417_1
retData.setObjectiveTemplateType(omsTargetTemplate_1.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:90416_1
retData.setIsLeft(omsTargetTemplate_1.getIsLeft());//SimpleFieldAssign//sourceId:499253_1
retData.setIsTargetValue(omsTargetTemplate_1.getIsTargetValue());//SimpleFieldAssign//sourceId:499252_1
retData.setUnit(omsTargetTemplate_1.getUnit());//SimpleFieldAssign//sourceId:90418_1
retData.setDigitalUnit(omsTargetTemplate_1.getDigitalUnit());//SimpleFieldAssign//sourceId:499254_1
retData.setObjectiveValueSource(omsTargetTemplate_1.getObjectiveValueSource());//SimpleFieldAssign//sourceId:90419_1
retData.setSystemDockingType(omsTargetTemplate_1.getSystemDockingType());//SimpleFieldAssign//sourceId:499255_1
    }
  

  
  
return retData;
  }
/**
   * D3-1查标签关系下指标模板列表[2710]
   * gen by moon at 6/18/2023, 8:41:37 PM
   */
  @Trace(operationName = "D3-1查标签关系下指标模板列表")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QueryTagRelTargetTempListRespDto queryTagRelTargetTempList(QueryTagRelTargetTempListReqDto reqDto){
    
      
      List<OmsTargetTemplate> listOmsTargetTemplate_3 =new ArrayList<>();
//步骤0: 3-13-04批量查业务应用内容标签记录列表 - batchQueryContTagRcordList
     List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord =new ArrayList<>();
    BatchQueryContTagRcordListReq batchQueryContTagRcordListReq=new BatchQueryContTagRcordListReq();
  batchQueryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:89648_1
batchQueryContTagRcordListReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:419623_1
if(reqDto!=null){
      batchQueryContTagRcordListReq.setContTagRcordList(reqDto.getContTagRcordList());//list-field-assign//sourceId:89645_1
    }
  
    /*3-13-04批量查业务应用内容标签记录列表[2246]   */
    Assert.isNull(batchQueryContTagRcordListReq.getBizAppContentCode(),"D3-1查标签关系下指标模板列表-3-13-04批量查业务应用内容标签记录列表-业务应用内容类型编码不能为空",false);
Assert.isNull(batchQueryContTagRcordListReq.getSpaceId(),"D3-1查标签关系下指标模板列表-3-13-04批量查业务应用内容标签记录列表-创建于空间ID不能为空",false);
      listOmsBasicContentTagRecord = mOmsBasicContentTagRecordService.batchQueryContTagRcordList(batchQueryContTagRcordListReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
    
//步骤1: 3-1-01批量查指标模板 - batchQueryTargetTemp
     List<OmsTargetTemplate> listOmsTargetTemplate =new ArrayList<>();
    if(listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&& listOmsBasicContentTagRecord.size()>0 ){
          BatchQueryTargetTempReq batchQueryTargetTempReq=new BatchQueryTargetTempReq();
  batchQueryTargetTempReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:419598_1
if(listOmsBasicContentTagRecord!= null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&&  listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)){
  batchQueryTargetTempReq.setTargetTempList(listOmsBasicContentTagRecord.stream().map(item->item.getObjectContentId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:419595_1
    }
if(reqDto!=null){
      batchQueryTargetTempReq.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:419602_1
batchQueryTargetTempReq.setObjectiveTemplateType(reqDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:419604_1
batchQueryTargetTempReq.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:419605_1
batchQueryTargetTempReq.setObjectiveValueSource(reqDto.getObjectiveValueSource());//SimpleFieldAssign//sourceId:419606_1
batchQueryTargetTempReq.setIsUseevaluationTemplate(reqDto.getIsUseevaluationTemplate());//SimpleFieldAssign//sourceId:419601_1
batchQueryTargetTempReq.setCreateInductionId(reqDto.getCreateInductionId());//SimpleFieldAssign//sourceId:419603_1
batchQueryTargetTempReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:419596_1
batchQueryTargetTempReq.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:419597_1
    }
  
    /*3-1-01批量查标签下的指标模板[2711]   */
    Assert.isNull(batchQueryTargetTempReq.getSpaceId(),"D3-1查标签关系下指标模板列表-3-1-01批量查标签下的指标模板-创建于空间ID不能为空",false);
      listOmsTargetTemplate = mOmsTargetTemplateService.batchQueryTargetTemp(batchQueryTargetTempReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
    
//步骤2: 3-3-03批量查询指标列表By指标模板Ids - batchQueryTargetObjListByIds
     List<OmsTargetObjective> listOmsTargetObjective =new ArrayList<>();
    BatchQueryTargetObjListByIdsReq batchQueryTargetObjListByIdsReq=new BatchQueryTargetObjListByIdsReq();
  batchQueryTargetObjListByIdsReq.setIsArchive("FALSE");//sourceId:382133_1
batchQueryTargetObjListByIdsReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:382134_1
if(listOmsTargetTemplate!= null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)&&  listOmsTargetTemplate !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)){
  batchQueryTargetObjListByIdsReq.setTargetObjList(listOmsTargetTemplate.stream().map(item->item.getObjectiveTemplateId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:382131_1
    }
if(reqDto!=null){
      batchQueryTargetObjListByIdsReq.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:419584_1
    }

    /*3-3-03批量查询指标列表By指标模板Ids[4934]   */
    Assert.isNull(batchQueryTargetObjListByIdsReq.getEvaluationTemplateId(),"D3-1查标签关系下指标模板列表-3-3-03批量查询指标列表By指标模板Ids-冗余评价模板ID不能为空",false);
Assert.isNull(batchQueryTargetObjListByIdsReq.getIsArchive(),"D3-1查标签关系下指标模板列表-3-3-03批量查询指标列表By指标模板Ids-是否存档不能为空",false);
Assert.isNull(batchQueryTargetObjListByIdsReq.getSpaceId(),"D3-1查标签关系下指标模板列表-3-3-03批量查询指标列表By指标模板Ids-创建于空间ID不能为空",false);
      listOmsTargetObjective = mOmsTargetObjectiveService.batchQueryTargetObjListByIds(batchQueryTargetObjListByIdsReq)/*vcase invoke 本地 method 方法调用;*/;



    
//步骤3: D2-执行集合去除已存在的数据服务(公共) - implementCollectionRemoveExistingDataCom
     ImplementCollectionRemoveExistingDataComRespDto implementCollectionRemoveExistingDataComRespDto = null;
    ImplementCollectionRemoveExistingDataComReqDto implementCollectionRemoveExistingDataComReqDto=new ImplementCollectionRemoveExistingDataComReqDto();
  if(listOmsTargetTemplate!= null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)&&  listOmsTargetTemplate !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)){
  implementCollectionRemoveExistingDataComReqDto.setAllSingleFieldDataSetList(listOmsTargetTemplate.stream().map(item->Long.valueOf(item.getObjectiveTemplateId()))
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:419619_1
    }
if(listOmsTargetObjective!= null&& !CollectionUtil.isEmpty(listOmsTargetObjective)&&  listOmsTargetObjective !=null&& !CollectionUtil.isEmpty(listOmsTargetObjective)){
implementCollectionRemoveExistingDataComReqDto.setDataSetSingleFieldPartList(listOmsTargetObjective.stream().map(item->Long.valueOf(item.getObjectiveTemplateId()))
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:419620_1
    }

    /*D2-执行集合去除已存在的数据服务(公共)[5111]   */

      implementCollectionRemoveExistingDataComRespDto = fwCompInterfaceModeClient.implementCollectionRemoveExistingDataCom(implementCollectionRemoveExistingDataComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;



// TODO: 2022/9/9  晓东，分页改造
      Page<?> page = CommonFunctionHelper.startPage(reqDto.getPageNum(),reqDto.getPageSize());
//步骤4: 3-1-01批量查指标模板 - batchQueryTargetTemp
     List<OmsTargetTemplate> listOmsTargetTemplate_2 =new ArrayList<>();
          BatchQueryTargetTempReq batchQueryTargetTempReq_1=new BatchQueryTargetTempReq();
  if(listOmsTargetTemplate!= null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)&&  listOmsTargetTemplate !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)){
      batchQueryTargetTempReq_1.setTargetTempList(listOmsTargetTemplate.stream().map(item->item.getObjectiveTemplateId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:84607_1
    }
        if(reqDto!=null){
      batchQueryTargetTempReq_1.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:84613_1
batchQueryTargetTempReq_1.setObjectiveTemplateType(reqDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:89628_1
batchQueryTargetTempReq_1.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:89629_1
batchQueryTargetTempReq_1.setObjectiveValueSource(reqDto.getObjectiveValueSource());//SimpleFieldAssign//sourceId:89630_1
batchQueryTargetTempReq_1.setIsUseevaluationTemplate(reqDto.getIsUseevaluationTemplate());//SimpleFieldAssign//sourceId:89631_1
batchQueryTargetTempReq_1.setIsTemporaryLock(reqDto.getIsTemporaryLock());//SimpleFieldAssign//sourceId:499240_1
batchQueryTargetTempReq_1.setCreateInductionId(reqDto.getCreateInductionId());//SimpleFieldAssign//sourceId:84614_1
batchQueryTargetTempReq_1.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:84608_1
batchQueryTargetTempReq_1.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:84609_1
    }
  
    /*3-1-01批量查指标模板（已去除存在的指标摸版）[2711]   */
    
      listOmsTargetTemplate_2 = mOmsTargetTemplateService.batchQueryTargetTemp(batchQueryTargetTempReq_1)/*vcase invoke 本地 method 方法调用;*/;
      
      
      listOmsTargetTemplate_3 = listOmsTargetTemplate_2;
    
QueryTagRelTargetTempListRespDto retData = new QueryTagRelTargetTempListRespDto();
  retData.setTargetTempList(listOmsTargetTemplate_3.stream().map(item -> BeanUtil.toBean(item, TargetTempDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:419626_1



      // TODO: 2022/12/16 分页特殊写法，不要被合掉，注意调用这个dubbo的controller层的分页代码要相应去掉
      if(page!=null){
          retData.setPageNum(page.getPageNum());
          retData.setPageSize(page.getPageSize());
          retData.setTotalNum(page.getTotal());
      }
return retData;
  }
/**
   * D3-1查指标模板列表[2209]
   * gen by moon at 5/29/2023, 9:56:09 PM
   */
  @Trace(operationName = "D3-1查指标模板列表")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QueryTargetTempListRespDto queryTargetTempList(QueryTargetTempListReqDto reqDto){
    
      
      List<OmsTargetTemplate> listOmsTargetTemplate_1 =new ArrayList<>();
      // TODO: 2022/9/9  晓东，分页改造
      Page<?> page = null;
if((reqDto!= null&&  reqDto.getContTagRcordList() !=null && reqDto.getContTagRcordList().size()==0)) {
        //if(D3-1查指标模板列表.业务应用内容标签记录列表数据集条数 等于 0)  24787

QuerySpaceInfoDetailComRespDto querySpaceInfoDetailComRespDto = null;
    QuerySpaceInfoDetailComReqDto querySpaceInfoDetailComReqDto=new QuerySpaceInfoDetailComReqDto();
  if(reqDto!=null){
      querySpaceInfoDetailComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:505399_1_24789
    }

    /*D1查询空间信息详情(公共)[5423]   */
    Assert.isNull(querySpaceInfoDetailComReqDto.getSpaceId(),"D3-1查指标模板列表-D1查询空间信息详情(公共)-空间ID不能为空",false);
      querySpaceInfoDetailComRespDto = fwBaseBaseClient.querySpaceInfoDetailCom(querySpaceInfoDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;



     List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord =new ArrayList<>();
    if(querySpaceInfoDetailComRespDto !=null){
          QueryContTagRcordListReq queryContTagRcordListReq=new QueryContTagRcordListReq();
  queryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:506442_1_24839
if(querySpaceInfoDetailComRespDto!=null){
      queryContTagRcordListReq.setTagName(querySpaceInfoDetailComRespDto.getAbbreviation());//SimpleFieldAssign//sourceId:506441_1_24839
    }
if(reqDto!=null){
      queryContTagRcordListReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:506446_1_24839
    }
  
    /*3-13-04查业务应用内容标签记录列表（约定空间简称查标签列表）[2243]   */
    Assert.isNull(queryContTagRcordListReq.getTagName(),"D3-1查指标模板列表-3-13-04查业务应用内容标签记录列表（约定空间简称查标签列表）-标签名称不能为空",false);
Assert.isNull(queryContTagRcordListReq.getBizAppContentCode(),"D3-1查指标模板列表-3-13-04查业务应用内容标签记录列表（约定空间简称查标签列表）-业务应用内容类型编码不能为空",false);
Assert.isNull(queryContTagRcordListReq.getSpaceId(),"D3-1查指标模板列表-3-13-04查业务应用内容标签记录列表（约定空间简称查标签列表）-创建于空间ID不能为空",false);
      listOmsBasicContentTagRecord = mOmsBasicContentTagRecordService.queryContTagRcordList(queryContTagRcordListReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
    // TODO: 2022/9/9  晓东，分页改造
    page = CommonFunctionHelper.startPage(reqDto.getPageNum(),reqDto.getPageSize());
     List<OmsTargetTemplate> listOmsTargetTemplate =new ArrayList<>();
    if(listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&& listOmsBasicContentTagRecord.size()>0 ){
          BatchQueryTargetTempReq batchQueryTargetTempReq=new BatchQueryTargetTempReq();
  if(listOmsBasicContentTagRecord!= null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&&  listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)){
  batchQueryTargetTempReq.setTargetTempList(listOmsBasicContentTagRecord.stream().map(item->item.getObjectContentId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:348781_1_24793
    }
if(reqDto!=null){
      batchQueryTargetTempReq.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:348789_1_24793
batchQueryTargetTempReq.setApplyStatus(reqDto.getApplyStatus());//SimpleFieldAssign//sourceId:348807_1_24793
batchQueryTargetTempReq.setObjectiveTemplateType(reqDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:348791_1_24793
batchQueryTargetTempReq.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:348792_1_24793
batchQueryTargetTempReq.setObjectiveValueSource(reqDto.getObjectiveValueSource());//SimpleFieldAssign//sourceId:348793_1_24793
batchQueryTargetTempReq.setIsRecommend(reqDto.getIsRecommend());//SimpleFieldAssign//sourceId:348805_1_24793
batchQueryTargetTempReq.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:348783_1_24793
batchQueryTargetTempReq.setCreateInductionId(reqDto.getCreateInductionId());//SimpleFieldAssign//sourceId:348790_1_24793
batchQueryTargetTempReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:348785_1_24793
    }
  
    /*3-1-01批量查指标模板[2711]   */
    
      listOmsTargetTemplate = mOmsTargetTemplateService.batchQueryTargetTemp(batchQueryTargetTempReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      listOmsTargetTemplate_1 = listOmsTargetTemplate;
           }
ImplementAsyncPublishAutoLockObjtiveTempComRespDto implementAsyncPublishAutoLockObjtiveTempComRespDto = null;
    if(listOmsTargetTemplate !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)&& listOmsTargetTemplate.size()>0 ){
          ImplementAsyncPublishAutoLockObjtiveTempComReqDto implementAsyncPublishAutoLockObjtiveTempComReqDto=new ImplementAsyncPublishAutoLockObjtiveTempComReqDto();
  implementAsyncPublishAutoLockObjtiveTempComReqDto.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:990875_1_43450
implementAsyncPublishAutoLockObjtiveTempComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:990874_1_43450
implementAsyncPublishAutoLockObjtiveTempComReqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID//sourceId:990876_1_43450
if(listOmsTargetTemplate!= null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)&&  listOmsTargetTemplate !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate)){
      implementAsyncPublishAutoLockObjtiveTempComReqDto.setTargetTempList(listOmsTargetTemplate.stream().map(item->item.getObjectiveTemplateId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:990877_1_43450
    }

    /*D3异步发布自动锁定指标模板(公共)[7008]   */
    Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto.getCreateInductionId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建人就职记录ID不能为空",false);
Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto.getSpaceId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建于空间ID不能为空",false);
Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto.getAppId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建于联盟应用ID不能为空",false);
      implementAsyncPublishAutoLockObjtiveTempComRespDto = implementAsyncPublishAutoLockObjtiveTempCom(implementAsyncPublishAutoLockObjtiveTempComReqDto)/*vcase invoke 同服务,同domain*/;



           }
      }
else if((reqDto!= null&&  reqDto.getContTagRcordList() !=null && reqDto.getContTagRcordList().size()>0)){
       //elseif(D3-1查指标模板列表.业务应用内容标签记录列表数据集条数 大于 0)  24791

List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord_2 =new ArrayList<>();
    BatchQueryContTagRcordListReq batchQueryContTagRcordListReq=new BatchQueryContTagRcordListReq();
  batchQueryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:65577_1_24792
batchQueryContTagRcordListReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:419624_1_24792
if(reqDto!=null){
      batchQueryContTagRcordListReq.setContTagRcordList(reqDto.getContTagRcordList());//list-field-assign//sourceId:65574_1_24792
    }

    /*3-13-04批量查业务应用内容标签记录列表[2246]   */
    Assert.isNull(batchQueryContTagRcordListReq.getBizAppContentCode(),"D3-1查指标模板列表-3-13-04批量查业务应用内容标签记录列表-业务应用内容类型编码不能为空",false);
Assert.isNull(batchQueryContTagRcordListReq.getSpaceId(),"D3-1查指标模板列表-3-13-04批量查业务应用内容标签记录列表-创建于空间ID不能为空",false);
      listOmsBasicContentTagRecord_2 = mOmsBasicContentTagRecordService.batchQueryContTagRcordList(batchQueryContTagRcordListReq)/*vcase invoke 本地 method 方法调用;*/;


    // TODO: 2022/9/9  晓东，分页改造
    page = CommonFunctionHelper.startPage(reqDto.getPageNum(),reqDto.getPageSize());
List<OmsTargetTemplate> listOmsTargetTemplate_2 =new ArrayList<>();
    if(listOmsBasicContentTagRecord_2 !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord_2)&& listOmsBasicContentTagRecord_2.size()>0 ){
          BatchQueryTargetTempReq batchQueryTargetTempReq_1=new BatchQueryTargetTempReq();
  if(listOmsBasicContentTagRecord_2!= null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord_2)&&  listOmsBasicContentTagRecord_2 !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord_2)){
  batchQueryTargetTempReq_1.setTargetTempList(listOmsBasicContentTagRecord_2.stream().map(item->item.getObjectContentId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:348781_1_24794
    }
if(reqDto!=null){
      batchQueryTargetTempReq_1.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:348789_1_24794
batchQueryTargetTempReq_1.setApplyStatus(reqDto.getApplyStatus());//SimpleFieldAssign//sourceId:348807_1_24794
batchQueryTargetTempReq_1.setObjectiveTemplateType(reqDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:348791_1_24794
batchQueryTargetTempReq_1.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:348792_1_24794
batchQueryTargetTempReq_1.setObjectiveValueSource(reqDto.getObjectiveValueSource());//SimpleFieldAssign//sourceId:348793_1_24794
batchQueryTargetTempReq_1.setIsRecommend(reqDto.getIsRecommend());//SimpleFieldAssign//sourceId:348805_1_24794
batchQueryTargetTempReq_1.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:348783_1_24794
batchQueryTargetTempReq_1.setCreateInductionId(reqDto.getCreateInductionId());//SimpleFieldAssign//sourceId:348790_1_24794
batchQueryTargetTempReq_1.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:348785_1_24794
    }

    /*3-1-01批量查指标模板[2711]   */

      listOmsTargetTemplate_2 = mOmsTargetTemplateService.batchQueryTargetTemp(batchQueryTargetTempReq_1)/*vcase invoke 本地 method 方法调用;*/;


      listOmsTargetTemplate_1 = listOmsTargetTemplate_2;
           }
ImplementAsyncPublishAutoLockObjtiveTempComRespDto implementAsyncPublishAutoLockObjtiveTempComRespDto_1 = null;
    if(listOmsTargetTemplate_2 !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate_2)&& listOmsTargetTemplate_2.size()>0 ){
          ImplementAsyncPublishAutoLockObjtiveTempComReqDto implementAsyncPublishAutoLockObjtiveTempComReqDto_1=new ImplementAsyncPublishAutoLockObjtiveTempComReqDto();
  implementAsyncPublishAutoLockObjtiveTempComReqDto_1.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:990875_1_43451
implementAsyncPublishAutoLockObjtiveTempComReqDto_1.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:990874_1_43451
implementAsyncPublishAutoLockObjtiveTempComReqDto_1.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID//sourceId:990876_1_43451
if(listOmsTargetTemplate_2!= null&& !CollectionUtil.isEmpty(listOmsTargetTemplate_2)&&  listOmsTargetTemplate_2 !=null&& !CollectionUtil.isEmpty(listOmsTargetTemplate_2)){
      implementAsyncPublishAutoLockObjtiveTempComReqDto_1.setTargetTempList(listOmsTargetTemplate_2.stream().map(item->item.getObjectiveTemplateId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:990877_1_43451
    }

    /*D3异步发布自动锁定指标模板(公共)[7008]   */
    Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto_1.getCreateInductionId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建人就职记录ID不能为空",false);
Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto_1.getSpaceId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建于空间ID不能为空",false);
Assert.isNull(implementAsyncPublishAutoLockObjtiveTempComReqDto_1.getAppId(),"D3-1查指标模板列表-D3异步发布自动锁定指标模板(公共)-创建于联盟应用ID不能为空",false);
      implementAsyncPublishAutoLockObjtiveTempComRespDto_1 = implementAsyncPublishAutoLockObjtiveTempCom(implementAsyncPublishAutoLockObjtiveTempComReqDto_1)/*vcase invoke 同服务,同domain*/;



           }
    }
//processBranchName:正常结束 ,processBranchId:25361

QueryTargetTempListRespDto retData = new QueryTargetTempListRespDto();
  retData.setTargetTempList(listOmsTargetTemplate_1.stream().map(item -> BeanUtil.toBean(item, TargetTempDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:348825_1



      // TODO: 2022/12/16 分页特殊写法，不要被合掉，注意调用这个dubbo的controller层的分页代码要相应去掉
      if(page!=null){
          retData.setPageNum(page.getPageNum());
          retData.setPageSize(page.getPageSize());
          retData.setTotalNum(page.getTotal());
      }
return retData;
  }
/**
   * D3-1查指标模板详情[2212]
   * gen by moon at 12/8/2022, 4:10:36 PM
   */
  @Trace(operationName = "D3-1查指标模板详情")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QueryTargetTempDetailRespDto queryTargetTempDetail(QueryTargetTempDetailReqDto reqDto){
    
      
      OmsTargetTemplate omsTargetTemplate_1 =null;
//步骤0: 3-1-01查指标模板详情 - queryTargetTempDetail
     OmsTargetTemplate omsTargetTemplate = null;
    QueryTargetTempDetailReq queryTargetTempDetailReq=new QueryTargetTempDetailReq();
  if(reqDto!=null){
      queryTargetTempDetailReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:64888_1
    }
  
    /*3-1-01查指标模板详情[2213]   */
    Assert.isNull(queryTargetTempDetailReq.getObjectiveTemplateId(),"D3-1查指标模板详情-3-1-01查指标模板详情-指标模板ID不能为空",false);
      omsTargetTemplate = mOmsTargetTemplateService.queryTargetTempDetail(queryTargetTempDetailReq);
      
      
      omsTargetTemplate_1 = omsTargetTemplate;
    
QueryTargetTempDetailRespDto retData = new QueryTargetTempDetailRespDto();
  if(omsTargetTemplate_1!=null){
      retData.setObjectiveTemplateId(omsTargetTemplate_1.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:64909_1
retData.setObjectiveTemplateType(omsTargetTemplate_1.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:64910_1
retData.setIsTargetValue(omsTargetTemplate_1.getIsTargetValue());//SimpleFieldAssign//sourceId:64911_1
retData.setObjectiveValueType(omsTargetTemplate_1.getObjectiveValueType());//SimpleFieldAssign//sourceId:64912_1
retData.setIsLeft(omsTargetTemplate_1.getIsLeft());//SimpleFieldAssign//sourceId:64913_1
retData.setIsUseevaluationTemplate(omsTargetTemplate_1.getIsUseevaluationTemplate());//SimpleFieldAssign//sourceId:64914_1
retData.setIsTemporaryLock(omsTargetTemplate_1.getIsTemporaryLock());//SimpleFieldAssign//sourceId:496480_1
retData.setUnit(omsTargetTemplate_1.getUnit());//SimpleFieldAssign//sourceId:64915_1
retData.setDigitalUnit(omsTargetTemplate_1.getDigitalUnit());//SimpleFieldAssign//sourceId:496481_1
retData.setObjectiveValueSource(omsTargetTemplate_1.getObjectiveValueSource());//SimpleFieldAssign//sourceId:64916_1
retData.setSystemDockingType(omsTargetTemplate_1.getSystemDockingType());//SimpleFieldAssign//sourceId:64917_1
retData.setIsResultIndicator(omsTargetTemplate_1.getIsResultIndicator());//SimpleFieldAssign//sourceId:64918_1
retData.setIsRecommend(omsTargetTemplate_1.getIsRecommend());//SimpleFieldAssign//sourceId:64919_1
retData.setObjectiveTemplateNumber(omsTargetTemplate_1.getObjectiveTemplateNumber());//SimpleFieldAssign//sourceId:64920_1
retData.setObjectiveTemplateName(omsTargetTemplate_1.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:64921_1
retData.setObjectiveTemplateDesc(omsTargetTemplate_1.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:64922_1
retData.setRemark(omsTargetTemplate_1.getRemark());//SimpleFieldAssign//sourceId:64923_1
retData.setObjectiveTemplate(omsTargetTemplate_1.getObjectiveTemplate());//SimpleFieldAssign//sourceId:64924_1
retData.setSubjectLifeCycle(omsTargetTemplate_1.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:64925_1
retData.setOperationInductionId(omsTargetTemplate_1.getOperationInductionId());//SimpleFieldAssign//sourceId:64926_1
retData.setOperateTime(omsTargetTemplate_1.getOperateTime());//SimpleFieldAssign//sourceId:64927_1
    }
  

  
  
return retData;
  }
/**
   * D3-1新增指标模板[2215]
   * gen by moon at 4/25/2024, 9:58:39 PM
   */
  @Trace(operationName = "D3-1新增指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public AddTargetTempRespDto addTargetTemp(AddTargetTempReqDto reqDto){
    
      
      String string_1 =null;
//步骤0: D3执行指标模板类型等信息分析(公共) - implementTargetTempTypeEtcAnalyseCom
     ImplementTargetTempTypeEtcAnalyseComRespDto implementTargetTempTypeEtcAnalyseComRespDto = null;
    ImplementTargetTempTypeEtcAnalyseComReqDto implementTargetTempTypeEtcAnalyseComReqDto=new ImplementTargetTempTypeEtcAnalyseComReqDto();
  if(reqDto!=null){
      implementTargetTempTypeEtcAnalyseComReqDto.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:499228_1
    }

    /*D3执行指标模板类型等信息分析(公共)[5435]   */
    Assert.isNull(implementTargetTempTypeEtcAnalyseComReqDto.getObjectiveValueType(),"D3-1新增指标模板-D3执行指标模板类型等信息分析(公共)-指标业务类型不能为空",false);
      implementTargetTempTypeEtcAnalyseComRespDto = implementTargetTempTypeEtcAnalyseCom(implementTargetTempTypeEtcAnalyseComReqDto)/*vcase invoke 同服务,同domain*/;




//步骤1: 3-1-01新增指标模板 - addTargetTemp
     String string = null;
    if(implementTargetTempTypeEtcAnalyseComRespDto !=null){
    OmsTargetTemplate omsTargetTemplate=new OmsTargetTemplate();
  omsTargetTemplate.setIsUseevaluationTemplate("FALSE");//sourceId:65054_1
  omsTargetTemplate.setApplyStatus("NOT_APPLY");//sourceId:376884_1
omsTargetTemplate.setObjectiveValueSource("MANUAL_FILLING");//sourceId:349029_1
omsTargetTemplate.setIsResultIndicator("FALSE");//sourceId:65056_1
if(reqDto!=null){
      omsTargetTemplate.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:65045_1
omsTargetTemplate.setRemark(reqDto.getRemark());//SimpleFieldAssign//sourceId:65047_1
omsTargetTemplate.setObjectiveTemplateDesc(reqDto.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:65048_1
omsTargetTemplate.setObjectiveTemplate(reqDto.getObjectiveTemplate());//SimpleFieldAssign//sourceId:65049_1
omsTargetTemplate.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:65052_1
omsTargetTemplate.setIsLeft(reqDto.getIsLeft());//SimpleFieldAssign//sourceId:65053_1
omsTargetTemplate.setUnit(reqDto.getUnit());//SimpleFieldAssign//sourceId:65055_1
omsTargetTemplate.setDigitalUnit(reqDto.getDigitalUnit());//SimpleFieldAssign//sourceId:376887_1
omsTargetTemplate.setIsRecommend(reqDto.getIsRecommend());//SimpleFieldAssign//sourceId:348770_1
omsTargetTemplate.setIsTemporaryLock(reqDto.getIsTemporaryLock());//SimpleFieldAssign//sourceId:349030_1
omsTargetTemplate.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:65057_1
    }
if(implementTargetTempTypeEtcAnalyseComRespDto!=null){
      omsTargetTemplate.setObjectiveTemplateType(implementTargetTempTypeEtcAnalyseComRespDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:65050_1
omsTargetTemplate.setIsTargetValue(implementTargetTempTypeEtcAnalyseComRespDto.getIsTargetValue());//SimpleFieldAssign//sourceId:65051_1
    }
  
    /*3-1-01新增指标模板[2216]   */
    Assert.isNull(omsTargetTemplate.getObjectiveTemplateName(),"D3-1新增指标模板-3-1-01新增指标模板-指标模板名称不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveTemplate(),"D3-1新增指标模板-3-1-01新增指标模板-示例描述不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveTemplateType(),"D3-1新增指标模板-3-1-01新增指标模板-指标模板类型不能为空",false);
Assert.isNull(omsTargetTemplate.getIsTargetValue(),"D3-1新增指标模板-3-1-01新增指标模板-是否有目标值不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveValueType(),"D3-1新增指标模板-3-1-01新增指标模板-指标业务类型不能为空",false);
Assert.isNull(omsTargetTemplate.getIsRecommend(),"D3-1新增指标模板-3-1-01新增指标模板-是否推荐不能为空",false);
Assert.isNull(omsTargetTemplate.getIsTemporaryLock(),"D3-1新增指标模板-3-1-01新增指标模板-临时锁定不能为空",false);
Assert.isNull(omsTargetTemplate.getIsUseevaluationTemplate(),"D3-1新增指标模板-3-1-01新增指标模板-是否用于评价模板不能为空",false);
Assert.isNull(omsTargetTemplate.getApplyStatus(),"D3-1新增指标模板-3-1-01新增指标模板-对接申请状态不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveValueSource(),"D3-1新增指标模板-3-1-01新增指标模板-目标值数据源不能为空",false);
Assert.isNull(omsTargetTemplate.getIsResultIndicator(),"D3-1新增指标模板-3-1-01新增指标模板-是否结果指标不能为空",false);
Assert.isNull(omsTargetTemplate.getSubjectLifeCycle(),"D3-1新增指标模板-3-1-01新增指标模板-主体生命周期不能为空",false);
      string = mOmsTargetTemplateService.addTargetTemp(omsTargetTemplate)/*vcase invoke 本地 method 方法调用;*/;
      
      
      string_1 = string;
           }

//步骤2: D1-2查空间详情(公共) - querySpaceDetailCom
     QuerySpaceDetailComRespDto querySpaceDetailComRespDto = null;
    QuerySpaceDetailComReqDto querySpaceDetailComReqDto=new QuerySpaceDetailComReqDto();
  querySpaceDetailComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:349228_1
  
    /*D1-2查空间详情(公共)[402]   */
    Assert.isNull(querySpaceDetailComReqDto.getSpaceId(),"D3-1新增指标模板-D1-2查空间详情(公共)-空间ID不能为空",false);
      querySpaceDetailComRespDto = fwBaseBaseClient.querySpaceDetailCom(querySpaceDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
    
//步骤3: D1-1新增对象标签(公共) - addObjectTagCom
     AddObjectTagComRespDto addObjectTagComRespDto = null;
    if(querySpaceDetailComRespDto !=null){
          AddObjectTagComReqDto addObjectTagComReqDto=new AddObjectTagComReqDto();
  if(querySpaceDetailComRespDto!=null){
      addObjectTagComReqDto.setTagName(querySpaceDetailComRespDto.getAbbreviation());//SimpleFieldAssign//sourceId:349222_1
    }
if(reqDto!=null){
      addObjectTagComReqDto.setTagSource(reqDto.getTagSource());//SimpleFieldAssign//sourceId:349223_1
addObjectTagComReqDto.setIsRecommend(reqDto.getIsRecommend());//SimpleFieldAssign//sourceId:349226_1
addObjectTagComReqDto.setBizAppCode(reqDto.getBizAppCode());//SimpleFieldAssign//sourceId:388714_1
addObjectTagComReqDto.setBusinessSceneCode(reqDto.getBusinessSceneCode());//SimpleFieldAssign//sourceId:349227_1
    }
  
    /*D1-1新增对象标签(公共)[2757]   */
    Assert.isNull(addObjectTagComReqDto.getTagName(),"D3-1新增指标模板-D1-1新增对象标签(公共)-标签名称不能为空",false);
Assert.isNull(addObjectTagComReqDto.getTagSource(),"D3-1新增指标模板-D1-1新增对象标签(公共)-标签来源方式不能为空",false);
Assert.isNull(addObjectTagComReqDto.getIsRecommend(),"D3-1新增指标模板-D1-1新增对象标签(公共)-是否推荐不能为空",false);
Assert.isNull(addObjectTagComReqDto.getBizAppCode(),"D3-1新增指标模板-D1-1新增对象标签(公共)-归属业务应用标识不能为空",false);
Assert.isNull(addObjectTagComReqDto.getBusinessSceneCode(),"D3-1新增指标模板-D1-1新增对象标签(公共)-归属业务场景标识不能为空",false);
      addObjectTagComRespDto = fwBaseTagClient.addObjectTagCom(addObjectTagComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
           }
    
//步骤4: 3-13-04新增业务应用内容标签记录 - addContTagRcord
     String string_2 = null;
    if(addObjectTagComRespDto !=null){
          OmsBasicContentTagRecord omsBasicContentTagRecord=new OmsBasicContentTagRecord();
  omsBasicContentTagRecord.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:349257_1
omsBasicContentTagRecord.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:349259_1
omsBasicContentTagRecord.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:349260_1
omsBasicContentTagRecord.setReleaseTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:349261_1
if(addObjectTagComRespDto!=null){
      omsBasicContentTagRecord.setTagName(addObjectTagComRespDto.getTagName());//SimpleFieldAssign//sourceId:349256_1
    }
if(string!=null){
      omsBasicContentTagRecord.setObjectContentId(string);//SimpleFieldAssign//sourceId:349258_1
    }
  
    /*3-13-04新增业务应用内容标签记录[2758]   */
    Assert.isNull(omsBasicContentTagRecord.getTagName(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-标签名称不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getObjectContentId(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-标签内容ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getBizAppContentCode(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-业务应用内容类型编码不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getSubjectLifeCycle(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-主体生命周期不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getReleaseInductionId(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-发布人就职记录ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getReleaseTime(),"D3-1新增指标模板-3-13-04新增业务应用内容标签记录-发布时间不能为空",false);
      string_2 = mOmsBasicContentTagRecordService.addContTagRcord(omsBasicContentTagRecord)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
    
AddTargetTempRespDto retData = new AddTargetTempRespDto();
  if(string_1!=null){
      retData.setObjectiveTemplateId(string_1);//SimpleFieldAssign//sourceId:65072_1
    }
  

  
  
return retData;
  }
/**
   * D3-1修改指标模板[2219]
   * gen by moon at 12/9/2022, 2:23:11 PM
   */
  @Trace(operationName = "D3-1修改指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public UpdateTargetTempRespDto updateTargetTemp(UpdateTargetTempReqDto reqDto){
    
      
      //步骤0: D3执行指标模板类型等信息分析(公共) - implementTargetTempTypeEtcAnalyseCom
     ImplementTargetTempTypeEtcAnalyseComRespDto implementTargetTempTypeEtcAnalyseComRespDto = null;
    ImplementTargetTempTypeEtcAnalyseComReqDto implementTargetTempTypeEtcAnalyseComReqDto=new ImplementTargetTempTypeEtcAnalyseComReqDto();
  if(reqDto!=null){
      implementTargetTempTypeEtcAnalyseComReqDto.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:499236_1
    }

    /*D3执行指标模板类型等信息分析(公共)[5435]   */
    Assert.isNull(implementTargetTempTypeEtcAnalyseComReqDto.getObjectiveValueType(),"D3-1修改指标模板-D3执行指标模板类型等信息分析(公共)-指标业务类型不能为空",false);
      implementTargetTempTypeEtcAnalyseComRespDto = implementTargetTempTypeEtcAnalyseCom(implementTargetTempTypeEtcAnalyseComReqDto);




//步骤1: 3-1-01修改指标模板 - updateTargetTemp
     boolean bOOLEAN ;
    if(implementTargetTempTypeEtcAnalyseComRespDto !=null){
    OmsTargetTemplate omsTargetTemplate=new OmsTargetTemplate();
  omsTargetTemplate.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:87133_1
if(omsTargetTemplate!=null && omsTargetTemplate.getSubjectLifeCycle()!=null &&  omsTargetTemplate.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsTargetTemplate.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
          }//sourceId:349113_1
omsTargetTemplate.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:87135_1
if(omsTargetTemplate!=null && omsTargetTemplate.getSubjectLifeCycle()!=null && omsTargetTemplate.getSubjectLifeCycle().equals("CURRENTLY_VALID")){
             omsTargetTemplate.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
            }//sourceId:349114_1
if(reqDto!=null){
      omsTargetTemplate.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:87115_1
omsTargetTemplate.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:87117_1
omsTargetTemplate.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:87120_1
omsTargetTemplate.setIsLeft(reqDto.getIsLeft());//SimpleFieldAssign//sourceId:87121_1
omsTargetTemplate.setUnit(reqDto.getUnit());//SimpleFieldAssign//sourceId:87123_1
omsTargetTemplate.setDigitalUnit(reqDto.getDigitalUnit());//SimpleFieldAssign//sourceId:376900_1
omsTargetTemplate.setObjectiveTemplateDesc(reqDto.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:87129_1
omsTargetTemplate.setRemark(reqDto.getRemark());//SimpleFieldAssign//sourceId:87130_1
omsTargetTemplate.setObjectiveTemplate(reqDto.getObjectiveTemplate());//SimpleFieldAssign//sourceId:87131_1
omsTargetTemplate.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:349104_1
    }
if(implementTargetTempTypeEtcAnalyseComRespDto!=null){
      omsTargetTemplate.setObjectiveTemplateType(implementTargetTempTypeEtcAnalyseComRespDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:87118_1
omsTargetTemplate.setIsTargetValue(implementTargetTempTypeEtcAnalyseComRespDto.getIsTargetValue());//SimpleFieldAssign//sourceId:87119_1
    }
  
    /*3-1-01修改指标模板[2761]   */
    Assert.isNull(omsTargetTemplate.getObjectiveTemplateId(),"D3-1修改指标模板-3-1-01修改指标模板-指标模板ID不能为空",false);
Assert.isNull(omsTargetTemplate.getOperateTime(),"D3-1修改指标模板-3-1-01修改指标模板-操作时间不能为空",false);
      bOOLEAN = mOmsTargetTemplateService.updateTargetTemp(omsTargetTemplate);
      
      
      
           }

UpdateTargetTempRespDto retData = new UpdateTargetTempRespDto();
  
  

  
  
return retData;
  }
/**
   * D3-1新增牵头部门的指标模板[2754]
   * gen by moon at 7/29/2023, 11:05:36 PM
   */
  @Trace(operationName = "D3-1新增牵头部门的指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public AddLeadDeptTargetTempRespDto addLeadDeptTargetTemp(AddLeadDeptTargetTempReqDto reqDto){
    
      
      String string_1 =null;
AddObjectTagComRespDto addObjectTagComRespDto_1 =null;
String string_3 =null;
//步骤0: D3执行指标模板类型等信息分析(公共) - implementTargetTempTypeEtcAnalyseCom
     ImplementTargetTempTypeEtcAnalyseComRespDto implementTargetTempTypeEtcAnalyseComRespDto = null;
    ImplementTargetTempTypeEtcAnalyseComReqDto implementTargetTempTypeEtcAnalyseComReqDto=new ImplementTargetTempTypeEtcAnalyseComReqDto();
  if(reqDto!=null){
      implementTargetTempTypeEtcAnalyseComReqDto.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:499233_1
    }

    /*D3执行指标模板类型等信息分析(公共)[5435]   */
    Assert.isNull(implementTargetTempTypeEtcAnalyseComReqDto.getObjectiveValueType(),"D3-1新增牵头部门的指标模板-D3执行指标模板类型等信息分析(公共)-指标业务类型不能为空",false);
      implementTargetTempTypeEtcAnalyseComRespDto = implementTargetTempTypeEtcAnalyseCom(implementTargetTempTypeEtcAnalyseComReqDto)/*vcase invoke 同服务,同domain*/;




//步骤1: 3-1-01新增指标模板 - addTargetTemp
     String string = null;
    if(implementTargetTempTypeEtcAnalyseComRespDto !=null){
    OmsTargetTemplate omsTargetTemplate=new OmsTargetTemplate();
  omsTargetTemplate.setIsUseevaluationTemplate("FALSE");//sourceId:86669_1
  omsTargetTemplate.setApplyStatus("NOT_APPLY");//sourceId:376883_1
omsTargetTemplate.setObjectiveValueSource("MANUAL_FILLING");//sourceId:89731_1
omsTargetTemplate.setIsResultIndicator("FALSE");//sourceId:86671_1
omsTargetTemplate.setIsTemporaryLock("TRUE");//sourceId:86681_1
if(reqDto!=null){
      omsTargetTemplate.setObjectiveTemplateName(reqDto.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:86673_1
omsTargetTemplate.setRemark(reqDto.getRemark());//SimpleFieldAssign//sourceId:86675_1
omsTargetTemplate.setObjectiveTemplateDesc(reqDto.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:86674_1
omsTargetTemplate.setObjectiveTemplate(reqDto.getObjectiveTemplate());//SimpleFieldAssign//sourceId:86676_1
omsTargetTemplate.setObjectiveValueType(reqDto.getObjectiveValueType());//SimpleFieldAssign//sourceId:86667_1
omsTargetTemplate.setIsLeft(reqDto.getIsLeft());//SimpleFieldAssign//sourceId:86668_1
omsTargetTemplate.setUnit(reqDto.getUnit());//SimpleFieldAssign//sourceId:86670_1
omsTargetTemplate.setDigitalUnit(reqDto.getDigitalUnit());//SimpleFieldAssign//sourceId:376886_1
omsTargetTemplate.setIsRecommend(reqDto.getIsRecommend());//SimpleFieldAssign//sourceId:376894_1
omsTargetTemplate.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:86677_1
    }
if(implementTargetTempTypeEtcAnalyseComRespDto!=null){
      omsTargetTemplate.setObjectiveTemplateType(implementTargetTempTypeEtcAnalyseComRespDto.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:86665_1
omsTargetTemplate.setIsTargetValue(implementTargetTempTypeEtcAnalyseComRespDto.getIsTargetValue());//SimpleFieldAssign//sourceId:86666_1
    }

    /*3-1-01新增指标模板[2216]   */
    Assert.isNull(omsTargetTemplate.getObjectiveTemplateName(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-指标模板名称不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveTemplate(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-示例描述不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveTemplateType(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-指标模板类型不能为空",false);
Assert.isNull(omsTargetTemplate.getIsTargetValue(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-是否有目标值不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveValueType(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-指标业务类型不能为空",false);
Assert.isNull(omsTargetTemplate.getIsLeft(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-是否左侧比例型不能为空",false);
Assert.isNull(omsTargetTemplate.getIsUseevaluationTemplate(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-是否用于评价模板不能为空",false);
Assert.isNull(omsTargetTemplate.getIsRecommend(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-是否推荐不能为空",false);
Assert.isNull(omsTargetTemplate.getApplyStatus(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-对接申请状态不能为空",false);
Assert.isNull(omsTargetTemplate.getObjectiveValueSource(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-目标值数据源不能为空",false);
Assert.isNull(omsTargetTemplate.getIsResultIndicator(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-是否结果指标不能为空",false);
Assert.isNull(omsTargetTemplate.getIsTemporaryLock(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-临时锁定不能为空",false);
Assert.isNull(omsTargetTemplate.getSubjectLifeCycle(),"D3-1新增牵头部门的指标模板-3-1-01新增指标模板-主体生命周期不能为空",false);
      string = mOmsTargetTemplateService.addTargetTemp(omsTargetTemplate)/*vcase invoke 本地 method 方法调用;*/;
      
      
      string_1 = string;
           }

//步骤2: D1-1新增对象标签(公共) - addObjectTagCom
     AddObjectTagComRespDto addObjectTagComRespDto = null;
    AddObjectTagComReqDto addObjectTagComReqDto=new AddObjectTagComReqDto();
  addObjectTagComReqDto.setTagSource("CREATE_SELF");//sourceId:87006_1
addObjectTagComReqDto.setIsRecommend("FALSE");//sourceId:419829_1
addObjectTagComReqDto.setBizAppCode("TARGET_TEMPLATE_APP");//CUSTOM_CONVENTION//sourceId:388717_1
addObjectTagComReqDto.setBusinessSceneCode("OBJECTIVE_TEMP_MGT");//CUSTOM_CONVENTION//sourceId:89727_1
if(reqDto!=null){
      addObjectTagComReqDto.setTagName(reqDto.getTagName());//SimpleFieldAssign//sourceId:87005_1
    }
  
    /*D1-1新增对象标签(当前部门标签)[2757]   */
    Assert.isNull(addObjectTagComReqDto.getTagName(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(当前部门标签)-标签名称不能为空",false);
Assert.isNull(addObjectTagComReqDto.getTagSource(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(当前部门标签)-标签来源方式不能为空",false);
Assert.isNull(addObjectTagComReqDto.getIsRecommend(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(当前部门标签)-是否推荐不能为空",false);
Assert.isNull(addObjectTagComReqDto.getBizAppCode(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(当前部门标签)-归属业务应用标识不能为空",false);
Assert.isNull(addObjectTagComReqDto.getBusinessSceneCode(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(当前部门标签)-归属业务场景标识不能为空",false);
      addObjectTagComRespDto = fwBaseTagClient.addObjectTagCom(addObjectTagComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      addObjectTagComRespDto_1 = addObjectTagComRespDto;
    
//步骤3: 3-13-04新增业务应用内容标签记录 - addContTagRcord
     String string_2 = null;
    if(addObjectTagComRespDto !=null){
          OmsBasicContentTagRecord omsBasicContentTagRecord=new OmsBasicContentTagRecord();
  omsBasicContentTagRecord.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:87030_1
omsBasicContentTagRecord.setThemeContentTypeCode("OMS_FRAMEWORK_SPACE");//sourceId:1092555_1
omsBasicContentTagRecord.setThemeContentId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:1092556_1
omsBasicContentTagRecord.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:87031_1
omsBasicContentTagRecord.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:87032_1
omsBasicContentTagRecord.setReleaseTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:87033_1
if(addObjectTagComRespDto!=null){
      omsBasicContentTagRecord.setTagName(addObjectTagComRespDto.getTagName());//SimpleFieldAssign//sourceId:87027_1
    }
if(string!=null){
      omsBasicContentTagRecord.setObjectContentId(string);//SimpleFieldAssign//sourceId:87028_1
    }
  
    /*3-13-04新增业务应用内容标签记录[2758]   */
    Assert.isNull(omsBasicContentTagRecord.getTagName(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-标签名称不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getObjectContentId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-标签内容ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getBizAppContentCode(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-业务应用内容类型编码不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getThemeContentTypeCode(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-主题内容类型编码不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getThemeContentId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-主题内容ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getSubjectLifeCycle(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-主体生命周期不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getReleaseInductionId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-发布人就职记录ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord.getReleaseTime(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录-发布时间不能为空",false);
      string_2 = mOmsBasicContentTagRecordService.addContTagRcord(omsBasicContentTagRecord)/*vcase invoke 本地 method 方法调用;*/;
      
      
      string_3 = string_2;
           }
    
//步骤4: D1-2查空间详情(公共) - querySpaceDetailCom
     QuerySpaceDetailComRespDto querySpaceDetailComRespDto = null;
    QuerySpaceDetailComReqDto querySpaceDetailComReqDto=new QuerySpaceDetailComReqDto();
  querySpaceDetailComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:89076_1
  
    /*D1-2查空间详情(公共)[402]   */
    Assert.isNull(querySpaceDetailComReqDto.getSpaceId(),"D3-1新增牵头部门的指标模板-D1-2查空间详情(公共)-空间ID不能为空",false);
      querySpaceDetailComRespDto = fwBaseBaseClient.querySpaceDetailCom(querySpaceDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
    
//步骤5: D1-1新增对象标签(公共) - addObjectTagCom
     AddObjectTagComRespDto addObjectTagComRespDto_2 = null;
    if(querySpaceDetailComRespDto !=null){
          AddObjectTagComReqDto addObjectTagComReqDto_1=new AddObjectTagComReqDto();
  addObjectTagComReqDto_1.setTagSource("CREATE_SELF");//sourceId:349216_1
addObjectTagComReqDto_1.setIsRecommend("TRUE");//sourceId:349219_1
addObjectTagComReqDto_1.setBizAppCode("TARGET_TEMPLATE_APP");//CUSTOM_CONVENTION//sourceId:388718_1
addObjectTagComReqDto_1.setBusinessSceneCode("OBJECTIVE_TEMP_MGT");//CUSTOM_CONVENTION//sourceId:349220_1
if(querySpaceDetailComRespDto!=null){
      addObjectTagComReqDto_1.setTagName(querySpaceDetailComRespDto.getAbbreviation());//SimpleFieldAssign//sourceId:349215_1
    }
  
    /*D1-1新增对象标签(租户空间标签)[2757]   */
    Assert.isNull(addObjectTagComReqDto_1.getTagName(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(租户空间标签)-标签名称不能为空",false);
Assert.isNull(addObjectTagComReqDto_1.getTagSource(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(租户空间标签)-标签来源方式不能为空",false);
Assert.isNull(addObjectTagComReqDto_1.getBizAppCode(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(租户空间标签)-归属业务应用标识不能为空",false);
Assert.isNull(addObjectTagComReqDto_1.getBusinessSceneCode(),"D3-1新增牵头部门的指标模板-D1-1新增对象标签(租户空间标签)-归属业务场景标识不能为空",false);
      addObjectTagComRespDto_2 = fwBaseTagClient.addObjectTagCom(addObjectTagComReqDto_1).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
           }
    
//步骤6: 3-13-04新增业务应用内容标签记录 - addContTagRcord
     String string_4 = null;
    if(addObjectTagComRespDto_2 !=null){
          OmsBasicContentTagRecord omsBasicContentTagRecord_1=new OmsBasicContentTagRecord();
  omsBasicContentTagRecord_1.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:89070_1
omsBasicContentTagRecord_1.setThemeContentTypeCode("OMS_FRAMEWORK_SPACE");//sourceId:1092553_1
omsBasicContentTagRecord_1.setThemeContentId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:1092554_1
omsBasicContentTagRecord_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:89072_1
omsBasicContentTagRecord_1.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:89073_1
omsBasicContentTagRecord_1.setReleaseTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:89074_1
if(addObjectTagComRespDto_2!=null){
      omsBasicContentTagRecord_1.setTagName(addObjectTagComRespDto_2.getTagName());//SimpleFieldAssign//sourceId:89069_1
    }
if(string!=null){
      omsBasicContentTagRecord_1.setObjectContentId(string);//SimpleFieldAssign//sourceId:89071_1
    }
  
    /*3-13-04新增业务应用内容标签记录（空间名称标签）[2758]   */
    Assert.isNull(omsBasicContentTagRecord_1.getTagName(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-标签名称不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getObjectContentId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-标签内容ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getBizAppContentCode(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-业务应用内容类型编码不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getThemeContentTypeCode(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-主题内容类型编码不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getThemeContentId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-主题内容ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getSubjectLifeCycle(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-主体生命周期不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getReleaseInductionId(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-发布人就职记录ID不能为空",false);
Assert.isNull(omsBasicContentTagRecord_1.getReleaseTime(),"D3-1新增牵头部门的指标模板-3-13-04新增业务应用内容标签记录（空间名称标签）-发布时间不能为空",false);
      string_4 = mOmsBasicContentTagRecordService.addContTagRcord(omsBasicContentTagRecord_1)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
    
AddLeadDeptTargetTempRespDto retData = new AddLeadDeptTargetTempRespDto();
  if(string_1!=null){
      retData.setObjectiveTemplateId(string_1);//SimpleFieldAssign//sourceId:87051_1
    }
if(addObjectTagComRespDto_1!=null){
      retData.setTagId(addObjectTagComRespDto_1.getTagId());//SimpleFieldAssign//sourceId:87052_1
    }
if(string_3!=null){
      retData.setTagContentRecordId(string_3);//SimpleFieldAssign//sourceId:87053_1
    }
  

  
  
return retData;
  }
/**
   * D3-1删除牵头部门的指标模板[2763]
   * gen by moon at 12/2/2022, 5:07:39 PM
   */
  @Trace(operationName = "D3-1删除牵头部门的指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public DeleteLeadDeptTargetTempRespDto deleteLeadDeptTargetTemp(DeleteLeadDeptTargetTempReqDto reqDto){
    
      
      //virtualUsage 3-3-03查指标列表  19452
      List<OmsTargetObjective> listOmsTargetObjective =new ArrayList<>();
    QueryTargetObjListReq queryTargetObjListReq=new QueryTargetObjListReq();
  queryTargetObjListReq.setLevelNumber(Long.valueOf(1));//CUSTOM_CONVENTION//sourceId:480211_1_19452
  queryTargetObjListReq.setArchivngType("NOT_ARCHIVE");//sourceId:376919_1_19452
queryTargetObjListReq.setIsArchive("FALSE");//sourceId:376907_1_19452
if(reqDto!=null){
      queryTargetObjListReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:376910_1_19452
    }
  
    /*3-3-03查指标列表[2692]   */
    Assert.isNull(queryTargetObjListReq.getObjectiveTemplateId(),"D3-1删除牵头部门的指标模板-3-3-03查指标列表-冗余指标模板ID不能为空",false);
Assert.isNull(queryTargetObjListReq.getLevelNumber(),"D3-1删除牵头部门的指标模板-3-3-03查指标列表-层级不能为空",false);
Assert.isNull(queryTargetObjListReq.getArchivngType(),"D3-1删除牵头部门的指标模板-3-3-03查指标列表-存档类型不能为空",false);
Assert.isNull(queryTargetObjListReq.getIsArchive(),"D3-1删除牵头部门的指标模板-3-3-03查指标列表-是否存档不能为空",false);
      listOmsTargetObjective = mOmsTargetObjectiveService.queryTargetObjList(queryTargetObjListReq);
      
      
      
if((listOmsTargetObjective!= null&&  listOmsTargetObjective !=null && listOmsTargetObjective.size()==0)) {
        //if(3-3-03查指标列表.指标列表数据集条数 等于 0)  19453
        
List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord =new ArrayList<>();
    QueryContTagRcordListReq queryContTagRcordListReq=new QueryContTagRcordListReq();
  queryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:87190_1_19636
queryContTagRcordListReq.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:87195_1_19636
if(reqDto!=null){
      queryContTagRcordListReq.setObjectContentId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:87191_1_19636
    }
  
    /*3-13-04查业务应用内容标签记录列表[2243]   */
    Assert.isNull(queryContTagRcordListReq.getObjectContentId(),"D3-1删除牵头部门的指标模板-3-13-04查业务应用内容标签记录列表-标签内容ID不能为空",false);
Assert.isNull(queryContTagRcordListReq.getBizAppContentCode(),"D3-1删除牵头部门的指标模板-3-13-04查业务应用内容标签记录列表-业务应用内容类型编码不能为空",false);
Assert.isNull(queryContTagRcordListReq.getSpaceId(),"D3-1删除牵头部门的指标模板-3-13-04查业务应用内容标签记录列表-创建于空间ID不能为空",false);
      listOmsBasicContentTagRecord = mOmsBasicContentTagRecordService.queryContTagRcordList(queryContTagRcordListReq);
      
      
      
boolean bOOLEAN ;
    if(listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&& listOmsBasicContentTagRecord.size()>0 &&listOmsBasicContentTagRecord!= null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&&  listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&& listOmsBasicContentTagRecord.size()>0 ){
          List<String> listString=new ArrayList<>();
  listString = listOmsBasicContentTagRecord.stream().map(item->item.getTagContentRecordId())
        .collect(Collectors.toList());/*list-to-strings*///sourceId:87202_1_19637
  
    /*3-13-04批量删业务应用内容标签记录[2765]   */
    
      bOOLEAN = mOmsBasicContentTagRecordService.batchDeleteContTagRcord(listString);
      
      
      
           }
boolean bOOLEAN_1 ;
    String string=new String();
  if(reqDto!=null){
      string=reqDto.getObjectiveTemplateId();;//SimpleFieldAssign//sourceId:87198_1_19638
    }
  
    /*3-1-01删除指标模板[2764]   */
    Assert.isNull(string,"D3-1删除牵头部门的指标模板-3-1-01删除指标模板-指标模板ID不能为空",false);
      bOOLEAN_1 = mOmsTargetTemplateService.deleteTargetTemp(string);
      
      
      
      }
else if((listOmsTargetObjective!= null&&  listOmsTargetObjective !=null && listOmsTargetObjective.size()>0)){
       //elseif(3-3-03查指标列表.指标列表数据集条数 大于 0)  19639
      
//异常结束 19640
      throw new BizException("C00130","对不起！该指标模板存在引用指标，暂不能删除。请先解除后再删除~",false);
    }
DeleteLeadDeptTargetTempRespDto retData = new DeleteLeadDeptTargetTempRespDto();
  
  

  
  
return retData;
  }
/**
   * D3-1检查删除牵头部门的指标模板条件[2767]
   * gen by moon at 10/8/2022, 2:54:38 AM
   */
  @Trace(operationName = "D3-1检查删除牵头部门的指标模板条件")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public CheckLeadDeptTargetTempRespDto checkLeadDeptTargetTemp(CheckLeadDeptTargetTempReqDto reqDto){


      List<OmsTargetObjective> listOmsTargetObjective_1 =new ArrayList<>();
//步骤0: 3-3-03查指标列表 - queryTargetObjList
     List<OmsTargetObjective> listOmsTargetObjective =new ArrayList<>();
    QueryTargetObjListReq queryTargetObjListReq=new QueryTargetObjListReq();
  queryTargetObjListReq.setSubjectLifeCycle("EDITING");//sourceId:87238_1
if(reqDto!=null){
      queryTargetObjListReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:87241_1
queryTargetObjListReq.setCorrelationLastTargetCatId(reqDto.getCorrelationLastTargetCatId());//SimpleFieldAssign//sourceId:87239_1
    }

    /*3-3-03查指标列表[2692]   */
    Assert.isNull(queryTargetObjListReq.getObjectiveTemplateId(),"D3-1检查删除牵头部门的指标模板条件-3-3-03查指标列表-冗余指标模板ID不能为空",false);
Assert.isNull(queryTargetObjListReq.getCorrelationLastTargetCatId(),"D3-1检查删除牵头部门的指标模板条件-3-3-03查指标列表-关联末级目标分类ID不能为空",false);
Assert.isNull(queryTargetObjListReq.getSubjectLifeCycle(),"D3-1检查删除牵头部门的指标模板条件-3-3-03查指标列表-主体生命周期不能为空",false);
      listOmsTargetObjective = mOmsTargetObjectiveService.queryTargetObjList(queryTargetObjListReq);


      listOmsTargetObjective_1 = listOmsTargetObjective;

CheckLeadDeptTargetTempRespDto retData = new CheckLeadDeptTargetTempRespDto();
  retData.setTargetObjList(listOmsTargetObjective_1.stream().map(item->item.getObjectiveId())
        .collect(Collectors.toList()));/*list-to-strings*///sourceId:87258_1




return retData;
  }
/**
   * D3-2删除指标模板[4936]
   * gen by moon at 10/18/2022, 6:11:32 AM
   */
  @Trace(operationName = "D3-2删除指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public DeleteTargetTempRespDto deleteTargetTemp(DeleteTargetTempReqDto reqDto){


      //virtualUsage 3-1-01查指标模板生命周期状态  19687
      OmsTargetTemplate omsTargetTemplate = null;
    QueryTargetTempDetailReq queryTargetTempDetailReq=new QueryTargetTempDetailReq();
  queryTargetTempDetailReq.setSubjectLifeCycle("EDITING");//sourceId:382216_1_19687
if(reqDto!=null){
      queryTargetTempDetailReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:382214_1_19687
    }

    /*3-1-01查指标模板生命周期状态[2213]   */
    Assert.isNull(queryTargetTempDetailReq.getObjectiveTemplateId(),"D3-2删除指标模板-3-1-01查指标模板生命周期状态-指标模板ID不能为空",false);
Assert.isNull(queryTargetTempDetailReq.getSubjectLifeCycle(),"D3-2删除指标模板-3-1-01查指标模板生命周期状态-主体生命周期不能为空",false);
      omsTargetTemplate = mOmsTargetTemplateService.queryTargetTempDetail(queryTargetTempDetailReq);



if((omsTargetTemplate != null )) {
        //if(3-1-01查指标模板生命周期状态.出参 值不等于空 )  19688

List<OmsTargetObjective> listOmsTargetObjective =new ArrayList<>();
    QueryTargetObjListReq queryTargetObjListReq=new QueryTargetObjListReq();
  queryTargetObjListReq.setIsArchive("FALSE");//sourceId:382192_1_19689
if(reqDto!=null){
      queryTargetObjListReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:382195_1_19689
    }

    /*3-3-03查指标列表[2692]   */
    Assert.isNull(queryTargetObjListReq.getObjectiveTemplateId(),"D3-2删除指标模板-3-3-03查指标列表-冗余指标模板ID不能为空",false);
Assert.isNull(queryTargetObjListReq.getIsArchive(),"D3-2删除指标模板-3-3-03查指标列表-是否存档不能为空",false);
      listOmsTargetObjective = mOmsTargetObjectiveService.queryTargetObjList(queryTargetObjListReq);



if((listOmsTargetObjective!= null&&  listOmsTargetObjective !=null && listOmsTargetObjective.size()==0)) {
        //if(3-3-03查指标列表.指标列表数据集条数 等于 0)  19690

List<OmsBasicContentTagRecord> listOmsBasicContentTagRecord =new ArrayList<>();
    QueryContTagRcordListReq queryContTagRcordListReq=new QueryContTagRcordListReq();
  queryContTagRcordListReq.setBizAppContentCode("OBJECTIVE_TEMPLATE");//sourceId:382242_1_19691
if(reqDto!=null){
      queryContTagRcordListReq.setObjectContentId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:382206_1_19691
    }

    /*3-13-04查业务应用内容标签记录列表[2243]   */
    Assert.isNull(queryContTagRcordListReq.getObjectContentId(),"D3-2删除指标模板-3-13-04查业务应用内容标签记录列表-标签内容ID不能为空",false);
Assert.isNull(queryContTagRcordListReq.getBizAppContentCode(),"D3-2删除指标模板-3-13-04查业务应用内容标签记录列表-业务应用内容类型编码不能为空",false);
      listOmsBasicContentTagRecord = mOmsBasicContentTagRecordService.queryContTagRcordList(queryContTagRcordListReq);



boolean bOOLEAN ;
    if(listOmsBasicContentTagRecord !=null&& !CollectionUtil.isEmpty(listOmsBasicContentTagRecord)&& listOmsBasicContentTagRecord.size()>0 ){
          List<String> listString=new ArrayList<>();
  listString = listOmsBasicContentTagRecord.stream().map(item->item.getTagContentRecordId())
        .collect(Collectors.toList());/*list-to-strings*///sourceId:382212_1_19692

    /*3-13-04批量删业务应用内容标签记录[2765]   */

      bOOLEAN = mOmsBasicContentTagRecordService.batchDeleteContTagRcord(listString);



           }
boolean bOOLEAN_1 ;
    String string=new String();
  if(reqDto!=null){
      string=reqDto.getObjectiveTemplateId();;//SimpleFieldAssign//sourceId:382213_1_19693
    }

    /*3-1-01删除指标模板[2764]   */
    Assert.isNull(string,"D3-2删除指标模板-3-1-01删除指标模板-指标模板ID不能为空",false);
      bOOLEAN_1 = mOmsTargetTemplateService.deleteTargetTemp(string);



//processBranchName:正常结束 ,processBranchId:19694

      }
else{
       //else  19695

//异常结束 19696
      throw new BizException("C00130","对不起！该指标模板存在引用指标，暂不能删除。请先解除后再删除~",false);
    }
      }
else{
       //else  19697

//异常结束 19698
      throw new BizException("C00028","对不起，没有数据！！",false);
    }
DeleteTargetTempRespDto retData = new DeleteTargetTempRespDto();





return retData;
  }
/**
   * D3-2存档指标模板[4940]
   * gen by moon at 10/19/2022, 7:21:11 PM
   */
  @Trace(operationName = "D3-2存档指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ArchiveTargetTempRespDto archiveTargetTemp(ArchiveTargetTempReqDto reqDto){
    
      
      //步骤0: 3-1-01修改指标模板 - updateTargetTemp
     boolean bOOLEAN ;
    OmsTargetTemplate omsTargetTemplate=new OmsTargetTemplate();
  omsTargetTemplate.setSubjectLifeCycle("ARCHIVING");//sourceId:383414_1
omsTargetTemplate.setIsArchive("TRUE");//sourceId:383418_1
if(omsTargetTemplate!=null && omsTargetTemplate.getSubjectLifeCycle()!=null && omsTargetTemplate.getSubjectLifeCycle().equals("ARCHIVING")) {
              omsTargetTemplate.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//ARCHIVE_CURRENT_INDUCTIONID
          }//sourceId:383415_1
if(omsTargetTemplate!=null && omsTargetTemplate.getSubjectLifeCycle()!=null && omsTargetTemplate.getSubjectLifeCycle().equals("ARCHIVING")) {
              omsTargetTemplate.setOperateTime(CommonFunctionHelper.getCurrentTime());//HISTORICAL_ARCHIVING
          }//sourceId:383419_1
if(reqDto!=null){
      omsTargetTemplate.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:383413_1
    }
  
    /*3-1-01存档指标模板[2761]   */
    Assert.isNull(omsTargetTemplate.getObjectiveTemplateId(),"D3-2存档指标模板-3-1-01存档指标模板-指标模板ID不能为空",false);
Assert.isNull(omsTargetTemplate.getSubjectLifeCycle(),"D3-2存档指标模板-3-1-01存档指标模板-主体生命周期不能为空",false);
Assert.isNull(omsTargetTemplate.getIsArchive(),"D3-2存档指标模板-3-1-01存档指标模板-是否存档不能为空",false);
Assert.isNull(omsTargetTemplate.getOperationInductionId(),"D3-2存档指标模板-3-1-01存档指标模板-操作人就职记录ID不能为空",false);
Assert.isNull(omsTargetTemplate.getOperateTime(),"D3-2存档指标模板-3-1-01存档指标模板-操作时间不能为空",false);
      bOOLEAN = mOmsTargetTemplateService.updateTargetTemp(omsTargetTemplate);
      
      
      
    
ArchiveTargetTempRespDto retData = new ArchiveTargetTempRespDto();
  
  

  
  
return retData;
  }
/**
   * D3-2撤销存档指标模板[4942]
   * gen by moon at 10/19/2022, 7:21:12 PM
   */
  @Trace(operationName = "D3-2撤销存档指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public UndoArchiveTargetTempRespDto undoArchiveTargetTemp(UndoArchiveTargetTempReqDto reqDto){
    
      
      //步骤0: 3-1-01修改指标模板 - updateTargetTemp
     boolean bOOLEAN ;
    OmsTargetTemplate omsTargetTemplate=new OmsTargetTemplate();
  omsTargetTemplate.setIsArchive("FALSE");//sourceId:383450_1
omsTargetTemplate.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:383451_1
omsTargetTemplate.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID//sourceId:383452_1
omsTargetTemplate.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:383453_1
if(reqDto!=null){
      omsTargetTemplate.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:383449_1
    }
  
    /*3-1-01修改指标模板[2761]   */
    Assert.isNull(omsTargetTemplate.getObjectiveTemplateId(),"D3-2撤销存档指标模板-3-1-01修改指标模板-指标模板ID不能为空",false);
Assert.isNull(omsTargetTemplate.getIsArchive(),"D3-2撤销存档指标模板-3-1-01修改指标模板-是否存档不能为空",false);
Assert.isNull(omsTargetTemplate.getSubjectLifeCycle(),"D3-2撤销存档指标模板-3-1-01修改指标模板-主体生命周期不能为空",false);
Assert.isNull(omsTargetTemplate.getOperationInductionId(),"D3-2撤销存档指标模板-3-1-01修改指标模板-操作人就职记录ID不能为空",false);
Assert.isNull(omsTargetTemplate.getOperateTime(),"D3-2撤销存档指标模板-3-1-01修改指标模板-操作时间不能为空",false);
      bOOLEAN = mOmsTargetTemplateService.updateTargetTemp(omsTargetTemplate);
      
      
      
    
UndoArchiveTargetTempRespDto retData = new UndoArchiveTargetTempRespDto();
  
  

  
  
return retData;
  }
/**
   * D3-1查询编辑的指标模板[5274]
   * gen by moon at 11/23/2022, 10:40:03 PM
   */
  @Trace(operationName = "D3-1查询编辑的指标模板")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QueryEditTargetTempDetailRespDto queryEditTargetTempDetail(QueryEditTargetTempDetailReqDto reqDto){


      OmsTargetTemplate omsTargetTemplate_1 =null;
//步骤0: 3-1-01查指标模板详情 - queryTargetTempDetail
     OmsTargetTemplate omsTargetTemplate = null;
    QueryTargetTempDetailReq queryTargetTempDetailReq=new QueryTargetTempDetailReq();
  queryTargetTempDetailReq.setSubjectLifeCycle("EDITING");//sourceId:453542_1
if(reqDto!=null){
      queryTargetTempDetailReq.setObjectiveTemplateId(reqDto.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:453522_1
    }

    /*3-1-01查指标模板详情[2213]   */
    Assert.isNull(queryTargetTempDetailReq.getObjectiveTemplateId(),"D3-1查询编辑的指标模板-3-1-01查指标模板详情-指标模板ID不能为空",false);
Assert.isNull(queryTargetTempDetailReq.getSubjectLifeCycle(),"D3-1查询编辑的指标模板-3-1-01查指标模板详情-主体生命周期不能为空",false);
      omsTargetTemplate = mOmsTargetTemplateService.queryTargetTempDetail(queryTargetTempDetailReq);


      omsTargetTemplate_1 = omsTargetTemplate;

QueryEditTargetTempDetailRespDto retData = new QueryEditTargetTempDetailRespDto();
  if(omsTargetTemplate_1!=null){
      retData.setObjectiveTemplateId(omsTargetTemplate_1.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:453547_1
retData.setObjectiveTemplateType(omsTargetTemplate_1.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:453548_1
retData.setIsTargetValue(omsTargetTemplate_1.getIsTargetValue());//SimpleFieldAssign//sourceId:453549_1
retData.setObjectiveValueType(omsTargetTemplate_1.getObjectiveValueType());//SimpleFieldAssign//sourceId:453550_1
retData.setIsLeft(omsTargetTemplate_1.getIsLeft());//SimpleFieldAssign//sourceId:453551_1
retData.setIsUseevaluationTemplate(omsTargetTemplate_1.getIsUseevaluationTemplate());//SimpleFieldAssign//sourceId:453552_1
retData.setUnit(omsTargetTemplate_1.getUnit());//SimpleFieldAssign//sourceId:453553_1
retData.setDigitalUnit(omsTargetTemplate_1.getDigitalUnit());//SimpleFieldAssign//sourceId:453554_1
retData.setObjectiveValueSource(omsTargetTemplate_1.getObjectiveValueSource());//SimpleFieldAssign//sourceId:453555_1
retData.setSystemDockingType(omsTargetTemplate_1.getSystemDockingType());//SimpleFieldAssign//sourceId:453556_1
retData.setIsResultIndicator(omsTargetTemplate_1.getIsResultIndicator());//SimpleFieldAssign//sourceId:453557_1
retData.setIsRecommend(omsTargetTemplate_1.getIsRecommend());//SimpleFieldAssign//sourceId:453558_1
retData.setObjectiveTemplateNumber(omsTargetTemplate_1.getObjectiveTemplateNumber());//SimpleFieldAssign//sourceId:453559_1
retData.setObjectiveTemplateName(omsTargetTemplate_1.getObjectiveTemplateName());//SimpleFieldAssign//sourceId:453560_1
retData.setObjectiveTemplateDesc(omsTargetTemplate_1.getObjectiveTemplateDesc());//SimpleFieldAssign//sourceId:453561_1
retData.setRemark(omsTargetTemplate_1.getRemark());//SimpleFieldAssign//sourceId:453562_1
retData.setObjectiveTemplate(omsTargetTemplate_1.getObjectiveTemplate());//SimpleFieldAssign//sourceId:453563_1
    }




return retData;
  }
/**
   * D3执行指标模板类型等信息分析(公共)[5435]
   * gen by moon at 1/28/2023, 11:39:38 PM
   */
  @Trace(operationName = "D3执行指标模板类型等信息分析(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ImplementTargetTempTypeEtcAnalyseComRespDto implementTargetTempTypeEtcAnalyseCom(ImplementTargetTempTypeEtcAnalyseComReqDto reqDto){


      ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_1 =null;
ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_3 =null;
ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_6 =null;
ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_8 =null;
if((reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("NUMBER_GROWTH")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("NUMBER_DECLINE")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("PERCENTAGE_GROWTH")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("PERCENTAGE_DECLINE")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("RATIO_GROWTH")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("RATIO_DECLINE"))) {
        //if((D3执行指标模板类型等信息分析(公共).指标业务类型 等于 数量增长型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 数量降幅型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 百分比增长型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 百分比降幅型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 比率增长型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 比率降幅型))  24355

//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq.setIsTargetValue("TRUE");//sourceId:499184_1_25508

    /*M3是否有目标值（是）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq.getIsTargetValue(),"D3执行指标模板类型等信息分析(公共)-M3是否有目标值（是）-是否有目标值不能为空",false);
      receptionServiceRes = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq);


      receptionServiceRes_1 = receptionServiceRes;
//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_2 = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq_1=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq_1.setObjectiveTemplateType("RATION");//sourceId:499175_1_25509

    /*M3指标模板类型（定量）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_1.getObjectiveTemplateType(),"D3执行指标模板类型等信息分析(公共)-M3指标模板类型（定量）-指标模板类型不能为空",false);
      receptionServiceRes_2 = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq_1);


      receptionServiceRes_3 = receptionServiceRes_2;
      }
else if((reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("PROGRESS")||reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("SUBJECTIVE_QUALITATIVE"))){
       //elseif((D3执行指标模板类型等信息分析(公共).指标业务类型 等于 进度型 or D3执行指标模板类型等信息分析(公共).指标业务类型 等于 主观定性))  25504

if((reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("PROGRESS"))) {
        //if(D3执行指标模板类型等信息分析(公共).指标业务类型 等于 进度型)  25511

//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_4 = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq_2=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq_2.setIsTargetValue("TRUE");//sourceId:499184_1_25521

    /*M3是否有目标值（是）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_2.getIsTargetValue(),"D3执行指标模板类型等信息分析(公共)-M3是否有目标值（是）-是否有目标值不能为空",false);
      receptionServiceRes_4 = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq_2);


      receptionServiceRes_1 = receptionServiceRes_4;
//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_5 = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq_3=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq_3.setObjectiveTemplateType("QUALITATIVE");//sourceId:499173_1_28049

    /*M3指标模板类型（定性）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_3.getObjectiveTemplateType(),"D3执行指标模板类型等信息分析(公共)-M3指标模板类型（定性）-指标模板类型不能为空",false);
      receptionServiceRes_5 = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq_3);


      receptionServiceRes_6 = receptionServiceRes_5;
      }
else if((reqDto!= null&&  reqDto.getObjectiveValueType() !=null && reqDto.getObjectiveValueType().equals("SUBJECTIVE_QUALITATIVE"))){
       //elseif(D3执行指标模板类型等信息分析(公共).指标业务类型 等于 主观定性)  25514

//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_7 = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq_4=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq_4.setIsTargetValue("FALSE");//sourceId:499192_1_25516

    /*M3是否有目标值（否）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_4.getIsTargetValue(),"D3执行指标模板类型等信息分析(公共)-M3是否有目标值（否）-是否有目标值不能为空",false);
      receptionServiceRes_7 = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq_4);


      receptionServiceRes_8 = receptionServiceRes_7;
//ModelCode: receptionService
        ImplementAcceptTargetTempFieldsRespDto receptionServiceRes_9 = null;
    ImplementAcceptTargetTempFieldsReqDto receptionServiceReq_5=new ImplementAcceptTargetTempFieldsReqDto();
  receptionServiceReq_5.setObjectiveTemplateType("QUALITATIVE");//sourceId:499173_1_25515

    /*M3指标模板类型（定性）[5436]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_5.getObjectiveTemplateType(),"D3执行指标模板类型等信息分析(公共)-M3指标模板类型（定性）-指标模板类型不能为空",false);
      receptionServiceRes_9 = nbTargetTemp.implementAcceptTargetTempFields(receptionServiceReq_5);


      receptionServiceRes_6 = receptionServiceRes_9;
    }
    }
//processBranchName:正常结束 ,processBranchId:25518

ImplementTargetTempTypeEtcAnalyseComRespDto retData = new ImplementTargetTempTypeEtcAnalyseComRespDto();
  if(receptionServiceRes_6!=null){
      retData.setObjectiveTemplateType(receptionServiceRes_6.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:499226_1
    }
if(receptionServiceRes_3!=null){
      retData.setObjectiveTemplateType(receptionServiceRes_3.getObjectiveTemplateType());//SimpleFieldAssign//sourceId:499226_1
    }
if(receptionServiceRes_1!=null){
      retData.setIsTargetValue(receptionServiceRes_1.getIsTargetValue());//SimpleFieldAssign//sourceId:499227_1
    }
if(receptionServiceRes_8!=null){
      retData.setIsTargetValue(receptionServiceRes_8.getIsTargetValue());//SimpleFieldAssign//sourceId:499227_1
    }




return retData;
  }
/**
   * D3异步发布自动锁定指标模板(公共)[7008]
   * gen by moon at 5/29/2023, 9:56:18 PM
   */
  @Trace(operationName = "D3异步发布自动锁定指标模板(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ImplementAsyncPublishAutoLockObjtiveTempComRespDto implementAsyncPublishAutoLockObjtiveTempCom(ImplementAsyncPublishAutoLockObjtiveTempComReqDto reqDto){


      //virtualUsage M3异步开始  43439
      //ModelCode: asynchronizationStart
Callable<String> call = new Callable<String>() {

    @Override
    public String call() throws Exception {
        //执行方法
//virtualUsage M3业务应用公共字段推送内存  43448
      //ModelCode: publicFieldCache
        ImplementBizPublicFieldPushMemoryRespDto publicFieldCacheRes = null;
    ImplementBizPublicFieldPushMemoryReqDto publicFieldCacheReq=new ImplementBizPublicFieldPushMemoryReqDto();
  if(reqDto!=null){
      publicFieldCacheReq.setCreateInductionId(reqDto.getCreateInductionId());//SimpleFieldAssign//sourceId:990838_1_43448
publicFieldCacheReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:990839_1_43448
publicFieldCacheReq.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:990840_1_43448
    }

    /*M3业务应用公共字段推送内存[4520]  用于定时任务执行时，获取定时任务执行所需的公共信息，存入缓存，供定时任务中虚拟用况使用 */
    Assert.isNull(publicFieldCacheReq.getCreateInductionId(),"D3异步发布自动锁定指标模板(公共)-M3业务应用公共字段推送内存-创建人就职记录ID 不能为空",false);
Assert.isNull(publicFieldCacheReq.getSpaceId(),"D3异步发布自动锁定指标模板(公共)-M3业务应用公共字段推送内存-创建于空间ID不能为空",false);
Assert.isNull(publicFieldCacheReq.getAppId(),"D3异步发布自动锁定指标模板(公共)-M3业务应用公共字段推送内存-创建于联盟应用ID不能为空",false);
      publicFieldCacheRes = nbTargetTemp.implementBizPublicFieldPushMemory(publicFieldCacheReq);



if((reqDto!= null&&  reqDto.getTargetTempList() !=null && reqDto.getTargetTempList().size()>0)) {
        //if(D3异步发布自动锁定指标模板(公共).指标模板列表数据集条数 大于 0)  43442

//ModelCode: circulationCollections
        for (String circulationCollectionsRes: reqDto.getTargetTempList()){

OmsTargetTemplate omsTargetTemplate = null;
    QueryTargetTempDetailReq queryTargetTempDetailReq=new QueryTargetTempDetailReq();
  queryTargetTempDetailReq.setSubjectLifeCycle("EDITING");//sourceId:990869_1_43449
if(circulationCollectionsRes!=null){
      queryTargetTempDetailReq.setObjectiveTemplateId(circulationCollectionsRes);//SimpleFieldAssign//sourceId:990849_1_43449
    }

    /*3-1-01查指标模板是否临时锁定[2213]   */
    Assert.isNull(queryTargetTempDetailReq.getObjectiveTemplateId(),"D3异步发布自动锁定指标模板(公共)-3-1-01查指标模板是否临时锁定-指标模板ID不能为空",false);
Assert.isNull(queryTargetTempDetailReq.getSubjectLifeCycle(),"D3异步发布自动锁定指标模板(公共)-3-1-01查指标模板是否临时锁定-主体生命周期不能为空",false);
      omsTargetTemplate = mOmsTargetTemplateService.queryTargetTempDetail(queryTargetTempDetailReq)/*vcase invoke 本地 method 方法调用;*/;



if((omsTargetTemplate!= null&&  omsTargetTemplate.getIsTemporaryLock() !=null && omsTargetTemplate.getIsTemporaryLock().equals("TRUE"))) {
        //if(3-1-01查指标模板是否临时锁定.临时锁定 等于 是)  43452

OmsTargetObjective omsTargetObjective = null;
    if(omsTargetTemplate !=null){
          QueryTargetObjDetailReq queryTargetObjDetailReq=new QueryTargetObjDetailReq();
  queryTargetObjDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:990797_1_43453
if(omsTargetTemplate!=null){
      queryTargetObjDetailReq.setObjectiveTemplateId(omsTargetTemplate.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:990796_1_43453
    }

    /*3-3-03查指标模板实例指标（当前有效）[2697]   */
    Assert.isNull(queryTargetObjDetailReq.getObjectiveTemplateId(),"D3异步发布自动锁定指标模板(公共)-3-3-03查指标模板实例指标（当前有效）-冗余指标模板ID不能为空",false);
Assert.isNull(queryTargetObjDetailReq.getSubjectLifeCycle(),"D3异步发布自动锁定指标模板(公共)-3-3-03查指标模板实例指标（当前有效）-主体生命周期不能为空",false);
      omsTargetObjective = mOmsTargetObjectiveService.queryTargetObjDetail(queryTargetObjDetailReq)/*vcase invoke 本地 method 方法调用;*/;



           }
if((omsTargetObjective != null )) {
        //if(3-3-03查指标模板实例指标（当前有效）.出参 值不等于空 )  43454

boolean bOOLEAN ;
    if(omsTargetTemplate !=null){
          OmsTargetTemplate omsTargetTemplate_2=new OmsTargetTemplate();
  omsTargetTemplate_2.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:990830_1_43455
omsTargetTemplate_2.setIsTemporaryLock("FALSE");//sourceId:990835_1_43455
omsTargetTemplate_2.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:990833_1_43455
omsTargetTemplate_2.setReleaseTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:990834_1_43455
if(omsTargetTemplate!=null){
      omsTargetTemplate_2.setObjectiveTemplateId(omsTargetTemplate.getObjectiveTemplateId());//SimpleFieldAssign//sourceId:990829_1_43455
omsTargetTemplate_2.setReleaseInductionId(omsTargetTemplate.getOperationInductionId());//SimpleFieldAssign//sourceId:990832_1_43455
    }

    /*3-1-01发布指标模板（当前有效）[2761]   */
    Assert.isNull(omsTargetTemplate_2.getObjectiveTemplateId(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-指标模板ID不能为空",false);
Assert.isNull(omsTargetTemplate_2.getSubjectLifeCycle(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-主体生命周期不能为空",false);
Assert.isNull(omsTargetTemplate_2.getIsTemporaryLock(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-临时锁定不能为空",false);
Assert.isNull(omsTargetTemplate_2.getReleaseInductionId(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-发布人就职记录ID不能为空",false);
Assert.isNull(omsTargetTemplate_2.getOperateTime(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-操作时间不能为空",false);
Assert.isNull(omsTargetTemplate_2.getReleaseTime(),"D3异步发布自动锁定指标模板(公共)-3-1-01发布指标模板（当前有效）-发布时间不能为空",false);
      bOOLEAN = mOmsTargetTemplateService.updateTargetTemp(omsTargetTemplate_2)/*vcase invoke 本地 method 方法调用;*/;



           }
      }
      }
//ModelCode: circulationEnd
        }
//
      }
////virtualUsage M3异步结束  43440
//      //ModelCode: asynchronizationEnd
        return "";
   }
};
CommonFunctionHelper.asynExcute(call);
ImplementAsyncPublishAutoLockObjtiveTempComRespDto retData = new ImplementAsyncPublishAutoLockObjtiveTempComRespDto();





return retData;
  }
@Resource
 private MOmsBasicContentTagRecordService mOmsBasicContentTagRecordService;
@Resource
  private FwBaseBaseClient fwBaseBaseClient;
@Resource
  private FwBaseTagClient fwBaseTagClient;
@Resource
  private FwCompInterfaceModeClient fwCompInterfaceModeClient;
//@Resource
 //private undefinedService undefinedService;
@Resource
  private MOmsEvaBatchRelatedSetService mOmsEvaBatchRelatedSetService;

    //
}
